import { Application } from 'egg';
export default (app: Application) => {
    const { DataTypes: { STRING, DATE,TEXT } } = app.Sequelize;
    const Model = app.model.define('banner', {
        id: {
            type: STRING(25),
            primaryKey: true,
            comment: '主键',
          },
          name:{
            type: STRING(100),
            allowNull: true,
            comment: '名称',
          },
          url:{
              type:TEXT,
              allowNull: false,
              comment: 'url',
          },
          createdAt: {
            type: DATE,
            allowNull: true,
            field: 'created_at',
            comment: '创建时间',
          },
          updatedAt: {
            type: DATE,
            allowNull: true,
            field: 'updated_at',
            comment: '修改时间',
          },
    },{
        comment: '轮播图',
        tableName: 'banner',
    })
    return class Banner extends Model{
        id?:number
        name?:string
        url?:string
        createdAt?: Date;
    }
}